<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>
<h:body>

	<p:panel header="Invitation">
			<h:panelGrid columns="2">
				<p:outputLabel for="username" value="Username" />
				<p:inputText id="username" name="#{invitationBean.username}" />
				
				<p:outputLabel for="idBooking" value="Id Booking" />
				<p:inputText id="idBooking" name="#{invitationBean.idBooking}" />				
			</h:panelGrid>	
	</p:panel>
	
<h:form>
	<p:commandButton id="submit" type="submit" ajax="false" value="View" action="#{invitationBean.addInvitation()}" update="invitation" />
</h:form>
	<p:dataTable id="invitation" var="booking" value="#{invitationBean.bookingInvitation}">
		<p:column headerText="Price">  
            <h:outputText value="#{booking.packageChosen.price}" />  
        </p:column>  
  
        <p:column headerText="Excursion">  
            <h:outputText value="#{booking.packageChosen.excursion.type}" />  
        </p:column>  
  
        <p:column headerText="Departure date">  
            <h:outputText value="#{booking.packageChosen.departureTransport.departureDate}" />  
        </p:column>  
  
        <p:column headerText="Departure time">  
            <h:outputText value="#{booking.packageChosen.departureTransport.departureTime}" />  
        </p:column> 
        
          <p:column headerText="Return date">  
            <h:outputText value="#{booking.packageChosen.returnTransport.departureDate}" />  
        </p:column>  
  
        <p:column headerText="Departure time">  
            <h:outputText value="#{booking.packageChosen.returnTransport.departureTime}" />  
        </p:column> 
        
        <p:column>  
            <p:commandButton id="bookn" value="Book invitation" icon="ui-icon-search"  
                    action="bookInvitation" type="submit" ajax="false
                   "/>
                    <f:param name="passedPackage" value="#{booking.packageChosen}"/>
        </p:column> 
  
	</p:dataTable>
	
	

</h:body>
</html>